import {App, createVNode, render, VNode} from 'vue'
import wrap from './wrap.vue'

const directive = (vue:App) => {
    vue.directive('loading',{
        mounted(el,binding){
            const { value } = binding
            const icon = el.getAttribute('loading-icon')
            const label = el.getAttribute('loading-label')
            const labelColor = el.getAttribute('loading-label-color')
            // const node = createVNode(wrap,{el})
            // renderDom(node)
        }
    })
}

const renderDom = ( node:VNode) => {
    const content: any = document.createElement('div')
    render(node, content)
    document.body.appendChild(content.firstElementChild)
}

export default {
    install: (vue:App) => {
        directive(vue)
    }
}